package com.example.apiproject.service;

import com.example.apiproject.entity.Activities;
import com.example.apiproject.entity.form.AddActivityForm;
import com.example.apiproject.entity.form.PostActivitiesEntity;
import com.example.apiproject.utils.AppPageUtils;
import com.example.apiproject.utils.PageResult;
import com.github.pagehelper.Page;
import io.swagger.models.auth.In;
import org.springframework.data.domain.PageRequest;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * (Activities)表服务接口
 *
 * @author makejava
 * @since 2023-09-23 13:40:56
 */
public interface ActivitiesService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    Activities queryById(String id);

    /**
     * 条件分页查询
     * @param activities
     * @param pageNum
     * @param pageSize
     * @return
     */
    AppPageUtils queryByPage(Activities activities, Integer pageNum, Integer pageSize);

    /**
     * 新增数据
     *
     * @param activities 实例对象
     * @return 实例对象
     */
    int insert(AddActivityForm  activities, HttpServletRequest http);

    /**
     * 修改数据
     *
     * @param activities 实例对象
     * @return 实例对象
     */
    int update(Activities activities);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    boolean deleteById(Integer id);

    AppPageUtils queryPageListBytype(Integer pageNum, Integer pageSize, Integer type);

    /**
     * 根据用户id查询用户参与的活动
     * @param request 用户id
     * @return 活动集合
     */
   AppPageUtils queryByUserId(HttpServletRequest request,Activities activities,Integer pageNum,Integer pageSize);

    List<PostActivitiesEntity> queryRecent(HttpServletRequest request);

}
